package org.example.entity;

import org.example.dao.FullDataMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * DeptMapper类的作用就是填充数据
 */
public class DeptMapper implements FullDataMapper<Dept> {
    public Dept map(ResultSet rs) throws SQLException {
        Dept dept = new Dept();
        int deptId = rs.getInt("dept_id");
        String deptName = rs.getString("dept_name");
        String deptLoc = rs.getString("dept_loc");
        dept.setDeptId(deptId);
        dept.setDeptName(deptName);
        dept.setDeptLoc(deptLoc);
        return dept;
    }
}
